package com.leyantech.ecp.agenx.common.handler;

import com.leyantech.ecp.agenx.common.message.EnumWsFnType;

import io.vertx.core.Handler;
import io.vertx.core.json.JsonObject;

/**
 * @author eahau, {@literal <eahau@foxmail.com>}
 * @date 2022-11-08.
 */
public abstract class ActionHandler implements Handler<JsonObject> {

  @Override
  public final int hashCode() {
    return actionType().hashCode();
  }

  @Override
  public final boolean equals(Object obj) {
    if (obj instanceof ActionHandler) {
      return actionType().equals(((ActionHandler) obj).actionType());
    }
    return false;
  }

  public abstract EnumWsFnType actionType();

}
